class CreateRentals < ActiveRecord::Migration
  def self.up
    create_table :rentals, :force => true do |t|
      t.timestamp :pick_up
      t.timestamp :return
      t.integer :book_id, :null => false, :options =>
        "CONSTRAINT fk_rental_books REFERENCES books(id)"
      t.integer :user_id, :null => false, :options =>
        "CONSTRAINT fk_rental_users REFERENCES users(id)"

      t.timestamps
    end
  end

  def self.down
    drop_table :rentals
  end
end
